home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / misc / amag / sh9302a.lha / Tips+Tricks (S.36) / GetJoyData.c next >
C/C++ Source or Header  |  1993-11-10  |  548b  |  31 lines

  1. /* Getjoydata.c
  2.    für Aztec-C 3.6
  3.  */
  4.  
  5. #include <hardware/custom.h>
  6. #include <hardware/cia.h>
  7.  
  8. void main()
  9. {
  10.   puts("Joystick in Port 1!");
  11.  
  12.   do
  13.   {
  14.     if( custom.joy1dat&2 )
  15.       puts("rechts");
  16.  
  17.     if( custom.joy1dat&512 )
  18.       puts("links");
  19.  
  20.     if( ((custom.joy1dat&1) == 1)  ^
  21.         ((custom.joy1dat&2) == 2) )
  22.       puts("unten");
  23.  
  24.     if( ((custom.joy1dat&256) == 256)  ^
  25.         ((custom.joy1dat&512) == 512) )
  26.       puts("oben");
  27.  
  28.   } while( ciaa.ciapra&CIAF_GAMEPORT1 );
  29.     /* solange Abfragen, bis der Knopf gedrückt wird */
  30. }
  31.